package com.portico.dept.solarch

class ProjectDashboard {

    String trend ="Green";
    String currentStatus ="Green" ;
    String budget  ;
    String resources ;
    String timeline ;
    String quality ;
    String scope;
    String voc ;
    String comments ="" ;
    Project project ;
    static constraints = {
      trend(inList:["Green", "Green->Yellow" , "Yellow", "Yellow -> Green", "Yellow -> Red", "Red", "Red -> Yellow"]);
      currentStatus  (shared:"RYGList")
      budget (shared:"RYGList")
      resources(shared:"RYGList");
      timeline(shared:"RYGList");
      quality(shared:"RYGList");
      scope(shared:"RYGList");
      voc(shared:"RYGList");
      comments maxSize:4000
    }

  static belongsTo  = {project: Project }
  static mapping = {
    project lazy:false
  }

  String toString() {
    "${project.name}"
  }

  final static  CSV_HEADER = "{project.id}, {project.name}, {currentStatus}, {trend}, {budget}, {resources}, {timeline}, {quality}, {scope}, {voc}";

  String toCSVString() {
   "${project.id}, ${project.name}, ${currentStatus}, ${trend}, ${budget}, ${resources},  ${timeline}, ${quality}, ${scope}, ${voc}"
  }
}
